import { sm2 } from 'sm-crypto'
export const sm2Encrypt = (txt) => {
  const cipherMode = 1
  const publicKey =
    '04ead43cac51eda3013d9db63323f8532e23baf744ac852356dff9fa4f244d1d8a45ba6b758d5bd15434c2ed1cc198188c4493ae8b219c262a3b79eab93f4d21c4'
  return '04' + sm2.doEncrypt(txt, publicKey, cipherMode) // 加密结果
}

/**
 * 国密3加密
 * @param txt 要加密的明文
 * @returns 加密后密文
 */
import { sm3 } from 'sm-crypto'
export const sm3Encrypt = (txt) => {
  return sm3(txt) // 加密结果
}
